import { h } from 'vue';

export const columns = [
  {
    title: '用户ID',
    key: 'userId',
    width: 60,
  },
  {
    title: '提现单号',
    key: 'orderNo',
    width: 200,
  },
  {
    title: '角色id',
    key: 'roleId',
    width: 120,
  },
  {
    title: '提现金额',
    key: 'amount',
    width: 200,
  },
  {
    title: '提现方式',
    key: 'way',
    width: 100,
    render(row) {
      return h(
        'span',
        { style: row.way == 'wechat' ? 'color:green' : 'color:blue' },
        {
          default: () => (row.way == 'wechat' ? '微信' : row.way == 'alipay' ? '支付宝' : '未知'),
        }
      );
    },
  },
  {
    title: '提现类型',
    key: 'type',
    width: 100,
    render(row) {
      return h(
        'span',
        {
          /**
           * let color = '';
           *             switch (row.type) {
           *               case 'SIGN':
           *                 color = 'color:yellow';
           *                 break;
           *               case 'LEVEL':
           *                 color = 'color:burlywood';
           *                 break;
           *               case 'WEALTH':
           *                 color = 'color:green';
           *                 break;
           *               case 'BORADCAST':
           *                 color = 'color:orange';
           *                 break;
           *               case 'NEW':
           *                 color = 'color:blue';
           *                 break;
           *               case 'INVITE':
           *                 color = 'color:gray';
           *                 break;
           *               case 'SLV':
           *                 color = 'color:red';
           *                 break;
           */
          style:
            row.type == 'BORADCAST'
              ? 'color:orange'
              : row.type == 'NEW'
              ? 'color:blue'
              : row.type == 'WEALTH'
              ? 'color:green'
              : row.type == 'SLV'
              ? 'color:red'
              : 'color:burlywood',
        },
        {
          default: () => {
            let str = '';
            switch (row.type) {
              case 'SIGN':
                str = '签到奖励';
                break;
              case 'LEVEL':
                str = '等级红包';
                break;
              case 'WEALTH':
                str = '尊享收益';
                break;
              case 'BORADCAST':
                str = '主播福利';
                break;
              case 'NEW':
                str = '新人福利';
                break;
              case 'INVITE':
                str = '邀请红包';
                break;
              case 'SLV':
                str = '冲刺红包';
                break;
              case 'HLV':
                str = '高级红包';
                break;
              case 'BONUS':
                str = '隐藏福利';
                break;
            }
            return str;
          },
        }
      );
    },
  },
  {
    title: '提现状态',
    key: 'status',
    width: 100,
    render(row) {
      return h(
        'span',
        { style: row.status == 'true' ? 'color:green' : 'color:red' },
        {
          default: () => (row.status == 'true' ? '已通过' : row.status == 'reject' ? '已驳回' : row.status == 'refund' ? '已退还' :'待审核'),
        }
      );
    },
  },
  {
    title: '支付时间',
    key: 'createTime',
    width: 200,
  },
];
